package com.xmtlxx.oms.mapper;


import com.xmtlxx.oms.domain.Box;
import com.xmtlxx.oms.domain.bo.BoxBo;
import com.xmtlxx.oms.domain.vo.BoxVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 箱子Mapper接口
 *
 * @author xmtlxx
 * @date 2022-12-07
 */
public interface BoxMapper extends BaseMapperPlus<BoxMapper, Box, BoxVo> {
    /**
     * 根据条件分页查询箱子
     *
     * @param box 箱子
     * @return Page Box
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "b.create_by"),
        @DataColumn(key = "deptName", value = "b.dept_id"),
        @DataColumn(key = "userName", value = "b.create_by")
    })
    Page<BoxVo> selectPageBoxList(@Param("page") Page<Box> page, @Param("box") BoxBo box);

    /**
     * 查询箱子列表
     *
     * @param box 箱子
     * @return 箱子集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "b.create_by"),
        @DataColumn(key = "deptName", value = "b.dept_id"),
        @DataColumn(key = "userName", value = "b.create_by")
    })
    List<BoxVo> selectBoxList(@Param("box") BoxBo box);

    BoxVo selectBoxVoByID(String id);
}
